<template>
    <view class="identityPage">
		<text class="title">{{title}}</text>
		<view class="identityList flex">
			<block v-for="item in socialList" :key="item.type">
				<block v-if="item.meta.includes(pageName)">
					<view class="itemBox flex" @click="toHouseProperty(item)">
						<view class="item flex">
							<text class="itemTit">{{item.title}}</text>
							<text>{{item.desc}}</text>
						</view>
					</view>
				</block>
			</block>
		</view>
		
		<up-modal :show="showModelTxt" :closeOnClickOverlay="true" @close="showModelTxt=false" @confirm="showModelTxt=false">
			<view class="contentWrap flex">
				<view class="txtWrap flex bg-theme text-center col-fff font20 fontBold">
					<view>
						<view v-for="(item, index) in titList" :key="index">{{ item }}</view>
					</view>
				</view>
			</view>
		</up-modal>
    </view>
</template>

<script>
	export default {
        data() {
            return {
				pageName: "",
				title: "非沪籍一方是否满三年社保?",
				infos: {},
				selects: [
					{
						title: '本市连续缴纳社会保险或个人所得税',
						desc: '已满1年及以上',
						type: 'qualifiedFiveYears'
					},
					{
						title: '本市连续缴纳社会保险或个人所得税',
						desc: '未满1年',
						type: 'unqualifiedFiveYears'
					}
				],
				socialList: [
					{
						title: "已满",
						type: "certificateYes",
						desc: "",
						meta: ["certificateNo"]
					},
					{
						title: "未满",
						type: "certificateNo",
						desc: "",
						meta: ["certificateNo"]
					},
					{
						title: "已婚",
						type: "troopHuYesMerryed",
						desc: "",
						meta: ["troopHuYes"]
					},
					{
						title: "单身",
						type: "troopHuYesSingle",
						desc: "",
						meta: ["troopHuYes"]
					},
					{
						title: "已婚",
						type: "troopHuNoMerryed",
						desc: "",
						meta: ["troopHuNo"]
					},
					{
						title: "单身",
						type: "troopHuNoSingle",
						desc: "",
						meta: ["troopHuNo"]
					}
				],
				showModelTxt: false,
				titList: []
            }
        },
        //分享
        onShareAppMessage(res) {
        	return {
        		title: "上海限购查询，快来测测限购几套",
        		path: `/pages/tools/purchase/identity`,
        	}
        },
        onLoad(options){
			const optType = JSON.parse(options.info);
			
			this.pageName = optType.pageName;
			switch(optType.pageName){
				case "certificateNo":
				this.title = "非沪籍一方是否满三年社保?"
				break;
				case "troopHuYes":
				this.title = "您是否单身还是已婚?";
				break;
				case "troopHuNo":
				this.title = "您是否单身还是已婚?";
				break;
				default:
				break
			}
        },
		methods:{
			toHouseProperty(info){
				this.infos.houseFirst = info.type;
				switch(info.type){
					case "troopHuYesMerryed":
					this.titList = ['外环外不限购','外环内限购两套'];
					// this.restrictHouse = "restrictionTwo",
					break;

					case "troopHuYesSingle":
					this.titList = ['外环外不限购','外环内限购1套'];
					// this.restrictHouse = "restrictionOne",
					break;

					case "troopHuNoSingle":
					this.titList = ['外环外不限购','外环内限购1套'];
					// this.restrictHouse = "restrictionNone",
					break;

					case "troopHuNoMerryed":
					this.titList = ['外环外不限购','外环内限购1套'];
					// this.restrictHouse = "restrictionOne";
					break;

					case "certificateYes":
					this.titList = ['外环外不限购','外环内可再购1套'];
					// this.restrictHouse = "restrictionOne";
					break;

					case "certificateNo":
					this.titList = ['外环外不限购','外环内限购'];
					// this.restrictHouse = "restrictionNone";
					break;

					default:
					break
				}
				this.showModelTxt = true;
			}
		}
    }
</script>

<style scoped lang="scss">
	.identityPage{
		.title{
			margin-top: 20vh;
			font-size: 40rpx;
			text-align: center;
			display: block;
		}
		.identityList{
			flex-wrap: wrap;
			.itemBox{
				width: 33.3333%;
				height: 200rpx;
				margin-top: 60rpx;
				.item{
					width: 200rpx;
					height: 200rpx;
					text-align: center;
					border-radius: 50%;
					border: 1rpx solid $theme-color;
					flex-direction: column;
					font-size: 24rpx;
					line-height: 1.3;
					.itemTit{
						font-size: 32rpx;
						margin-bottom: 10rpx;
					}
				}
			}
		}
		.contentWrap{
			padding: 40rpx 0;
			.txtWrap{
				padding: 20rpx;
				width: 40vw;
				height: 40vw;
				line-height: 1.4;
				border-radius: 50%;
			}
			.pangFigure{
				width: 40vw;
				margin-left: -64rpx;
			}
		}
	}

</style>
